<script setup>
import { useRoute } from 'vue-router'
import { useRouteStore } from '@/pinia/modules/routeCache'
import { storeToRefs } from 'pinia'
// 导入vant定制主题资源
import configProviders from '@/assets/vant/config-provider.json'
const route = useRoute()
const { keepAliveViews, notKeepAliveViews } = storeToRefs(useRouteStore())
</script>
<template>
  <van-config-provider :theme-vars="configProviders">
    <router-view #default="{ Component }">
      <keep-alive
        :include="keepAliveViews"
        :exclude="notKeepAliveViews"
        :max="8"
      >
        <component :is="Component" :key="route.name" />
      </keep-alive>
    </router-view>
  </van-config-provider>
</template>
